package com.study.opensource.spring.provider.config;

import com.study.opensource.spring.provider.model.Person;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 许棒棒
 * @className com.study.study.opensource.spring.provider.config.PersonConfig
 * @description TODO 类描述
 * @date 2021/04/18 23:46:16
 */
@Configuration
@ConditionalOnClass(value = Person.class)
public class PersonConfig {

    @Bean
//    @ConditionalOnProperty(value = "person.enable", havingValue = "ok1")
    public Person person() {
        Person person = new Person();
        person.setAge(18);
        person.setName("张三");
        return person;
    }
}
